#pragma once

#include "types.h"
#include <glm/gtc/quaternion.hpp>

class Camera
{
public:
	/// Camera constructor.
	Camera(const U32 &width, const U32 &height);
	/// Camera destructor.
	~Camera();

	/// Calculate the perspective of the camera (projection matrix).
	const glm::mat4 &perspective(F32 fovx, F32 aspect, F32 znear, F32 zfar);
	void setView(const glm::mat4 &view) { viewMatrix = view; }

	const glm::mat4 &getViewMatrix() const { return viewMatrix; }
	const glm::mat4 &getProjectionMatrix() const { return projMatrix; }

	void prepare();

	void rotate(F32 angle, glm::vec3 axis);
	void translate(F32 x, F32 y, F32 z);
	void forward(F32 value);
	void left(F32 value);
	void up(F32 value);
		
protected:
	glm::mat4 projMatrix;
	glm::mat4 viewMatrix;

	glm::gtc::quaternion::quat qRotation;
	glm::vec3 position, fwdDir, leftDir, upDir;
};
